home *** CD-ROM | disk | FTP | other *** search
/ The PC-SIG Library 9 / The PC-SIG Library on CD ROM - Ninth Edition.iso / 801_900 / DISK0856 / DISK0856.ZIP / FONTEDIT.DOC < prev    next >
Text File  |  1987-06-15  |  18KB  |  397 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.                     Font Editing and Printing Package
  11.  
  12.                                Version 1.2
  13.  
  14.                                 -- by --
  15.  
  16.                        Synergy Software of Nebraska
  17.                             904 Lariat Circle
  18.                            Papillion, NE  68046
  19.  
  20.  
  21.           Copyright (C) 1986,1987 by Synergy Software of Nebraska
  22.  
  23.           Synergy  Software  of Nebraska (SSoN)  is  distributing 
  24.           FONT  EDITOR  under  the User  Support  concept.   This
  25.           utility  may  be freely distributed to  all  interested 
  26.           individuals  without further authorization  or  request
  27.           from SSoN as long as the cost of distribution does  not 
  28.           exceed $6.   However,  if you  like the utility,  we do 
  29.           request  a $10 registration fee,  which entitles you to 
  30.           information  on  the  latest copy  of  this  and  other 
  31.           packages designed by SSoN.
  32.  
  33.               SYNERGY SOFTWARE OF NEBRASKA RESERVES ALL OTHER  
  34.                          COPYRIGHT PRIVILEGES.
  35.  
  36.           All files to this package must remain intact and unmod-
  37.           ified and the entire package cannot be sold, although a 
  38.           distributing  fee of up to $6 may be applied.
  39.  
  40.           Since  this  utility is being distributed  without  any 
  41.           charge  or  obligation  to  buy,  Synergy  Software  of 
  42.           Nebraska  disclaims all warranties with respect to  the 
  43.           contents of this package and specifically disclaims any 
  44.           implied  warranties  of merchantability or fitness  for 
  45.           any particular purpose.  (In other words, "Don't look a 
  46.           gift horse in the mouth.")
  47.  
  48.           The source  code, incidentally,  is  available in  Turbo
  49.           Pascal for $10.
  50.  
  51.             Requires IBM-PC or campatible machine with CGA video.
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.                                 1                      Font Editor Version 1.2
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.                           Font Editor : Version 1.2
  72.  
  73.  
  74. This package:
  75.  
  76.      One  of the great things about the IBM-PC and family of computers is  the 
  77. ability  to  create and display your own special font  characters.  This  Font 
  78. Editor  package not only will help you design the special characters with  the 
  79. interactive  programs,  but  contains utilities to demonstrate the  method  by 
  80. which the fonts can be generated on the display console.
  81.      There  are,  unfortunately,  several restrictions placed upon this  capa-
  82. bility.   First,  the  special  characters  can only be  displayed  using  the 
  83. graphics modes of a Color/Graphics Adaptor (CGA) or Enhanced Graphics  Adaptor 
  84. (EGA) emulating the CGA.   If you are using a monochrome display system,  this
  85. program will not work.  Sorry, there is nothing that can be done about this.
  86.      Second,  the  special  font characters are only created in  the  graphics 
  87. modes  of the system (modes 0 through 3) which are the medium and high  resol-
  88. ution  graphics modes.   These modes,  unlike the text modes where  the  ASCII 
  89. character codes are stored in the display memory,  actually place the bit maps 
  90. of  the  characters into the display memory area.   (This is why  the  special 
  91. fonts  can  be  displayed.)  In the medium resolution  modes,  characters  are 
  92. displayed  in 40 columns across the screen;  while in high  resolution  modes, 
  93. characters are displayed in 80 columns.   Of course,  this is not the problem.
  94. The  problem  is that the CGA has limited memory resources and  therefore  can
  95. only  display  4  colors in medium res modes and 2 colors in high  res  modes.  
  96. Refer to your hardware reference manual (or any of a thousand books on the IBM 
  97. system hardware) for the reasons why this is so.
  98.      Third,  only the upper 128 characters of the video codes are redefinable.  
  99. The  lower 128 characters (called the ASCII codes) are in the system's ROM  at 
  100. high  memory  and cannot be changed.   (You can load them into RAM and  modify 
  101. them to your liking, though!)
  102.  
  103.      With these restrictions,  I still feel the IBM has the potential of being 
  104. somewhat  flexible  in what it can display if the software is designed  right.
  105. This package will help you in doing just that.
  106.  
  107.  
  108. What this package includes:
  109.  
  110.      This  package  is made up of two Font Editors (one for medium  resolution 
  111. modes  and one for high resolution modes) and a Turbo Pascal  routine  library 
  112. that  will demonstrate how the created fonts are loaded from file,  integrated 
  113. into  the  BIOS system of the computer,  and thus made available to  the  BIOS 
  114. display routines.
  115.      The  reason why there are two editors is because special font  characters 
  116. created  in medium resolution modes look different when displayed in the  high
  117. resolution  modes  (and vice versa).   The two editors are almost exactly  the 
  118. same.   The medium resolution editor ("FONTED40.COM"),  however, is limited in 
  119. the  number of characters that can be displayed on the screen  (40  characters 
  120. across)  and thus is not as verbose as the 80 column editor.   The best way to
  121. learn  how  to  use  the  editors  is  to  work  with  the  80  column  editor 
  122. ("FONTED80.COM")  until you feel comfortable with the questions asked and  the 
  123. options available.
  124.  
  125.  
  126.  
  127.                                 2                      Font Editor Version 1.2
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      The  Turbo  Pascal routine library is discussed more fully in  a  section 
  137. below.   The  following are the files and their date/time tags and sizes  that 
  138. are included in this package.   If any of these files are missing,  or if  any 
  139. have been altered in any way,  please contact us and we will provide you  with
  140. the entire package.
  141.  
  142.  
  143.  SCRIPT40 FNT     1024   6-14-87  10:06p - Sample font provided with pkg
  144.  FONTED40 FNT     1024   6-06-87   9:02a - Font set used by editor
  145.  SCRIPT80 FNT     1024   6-14-87  10:44p - Sample font provided with pkg
  146.  FONTED80 FNT     1024   6-06-87   8:57a - Font set used by editor
  147.  FONTEDIT DOC    19456   6-14-87  11:05p - Documentation to this package
  148.  FONTS    LIB     8184   6-14-87  10:23p - Turbo Pascal library for access
  149.  SAMPLE   PAS     2422   6-14-87  10:28p - Sample Program using FONTS.LIB
  150.  FONTED40 COM    23797   6-14-87  10:48p - 40 column font editor
  151.  FONTED80 COM    24166   6-14-87  10:48p - 80 column font editor
  152.  
  153.  
  154. The Font Editors:
  155.  
  156.      Since  the  commands and keys for both editors are  the  same,  when  the
  157. editor is mentioned, I actually mean either one.
  158.  
  159.      When  you  begin execution of the editor,  it will first ask you for  the
  160. name of the font file to be edited.  Like a text file, or other data file, the
  161. font  descriptions (the bit mapping of each special character font) are  saved
  162. off  into  a file with a specific name and can be called up at  any  time  for
  163. further editing.  Each file contains the bit mapping of a single font set (for 
  164. the entire 128 characters).   If you do not specify a file name, "WORK.FNT" is 
  165. loaded.   Of  course,  if  the file does not exist,  the new file  is  created 
  166. automatically.   With new files,  all special font characters are "cleared" or
  167. have their bits all set to "0".
  168.      Once the font file is loaded,  the main editor screen is displayed.   The 
  169. upper  left corner of the screen displays the main function key  options,  the 
  170. upper middle and right screen area is used while editing a specific  character
  171. and  will be discussed later,  and the bottom half of the screen displays  the 
  172. state of the entire font set as it presently exists (all 128 characters).   An 
  173. arrow character will appear at the location (0,0).
  174.  
  175. NOTE:   From this point on,  (x,y) will refer to the location within the  font 
  176. table where "x", the first digit (from 0 to 7), is the row down the screen and
  177. "y",  the second digit (from 0 to F [hex]),  is the column position across the 
  178. screen.   Locations  correspond to the ASCII values of the characters in hexa-
  179. decimal format.  That is (x,y) is associated with the ASCII character with the 
  180. hex value of xy.   For example, the character "a" has a ASCII hex value of 61; 
  181. therefore,  the corresponding location in the table is (6,1),  or the 7th  row 
  182. and 2nd column.
  183.  
  184.  
  185.      Moving the Arrow Pointer:
  186.  
  187.      The  arrow pointer is used to select the specific character you  wish  to 
  188. work with.  It may be used in telling the editor which character to edit or to 
  189. copy.   Think  of the arrow pointer as the location where activity is to  take
  190. place.
  191.  
  192.  
  193.                                 3                      Font Editor Version 1.2
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.      The  pointer is moved using the four arrow keys on the keypad.   In addi-
  203. tion, the <Home>, <End>, <CTRL><HOME>, and <CTRL><END> keys are supported with 
  204. this version.   These four keys move the arrow pointer to the beginning of the 
  205. present row, end of the present row, top left corner of the character set, and 
  206. bottom right corner of the character set respectively.
  207.  
  208.  
  209.      Loading a New File:
  210.  
  211.      The F1 key is used to load a new file from disk.  If the present font set 
  212. has not been saved since an update has occurred,  the editor will give you the 
  213. option to save the file before loading a new one.  When entering the file name
  214. (after  any  of  the prompts in the program),  the file  extension  ".FNT"  is 
  215. assumed if not entered.  (In fact, I suggest you always use the file extension 
  216. default.   This  will  prevent any problems from occurring in  confusing  font 
  217. files with other types of data files.)
  218.  
  219.  
  220.      Saving the Font to File:
  221.  
  222.      To save the presently loaded font to file,  use the F2 key.  It is a good
  223. idea  to get into the habit of saving the font after every 10 to 15 minutes of 
  224. work.  This could save you from losing a lot of hard work if the power were to 
  225. go out on your system.
  226.      The editor will let you specify the file to save to,  though the  default 
  227. name is the name of the font file you are presently working with.
  228.  
  229.  
  230.      Copying characters:
  231.  
  232.      You  can copy character bit maps directly from one to  another  character 
  233. through  the main menu with the F7 key;  thus eliminating having to enter  the 
  234. editor  mode  (described below) just to perform this task.   To  copy  a  font 
  235. character,  move the arrow to the location where the character is to be copied 
  236. TO  and strike the F7 key.   You will then be prompted to select the character
  237. from which to copy FROM by again moving the arrow and striking the RETURN key.  
  238. You can abort the copy action by simply striking the ESC key at the prompt.
  239.  
  240.  
  241.      Copying the entire ROM Character set:
  242.  
  243.      A feature has been provided that will allow you to copy the entire ROM'ed 
  244. character  set  into the working table.   The F6 key performs this  operation.  
  245. Make sure that before you make the copy,  the contents of the present font set
  246. is saved.   Once the ROM set is loaded, you can then manipulate the characters 
  247. in any fashion you desire and then save it to a font file, just like any other 
  248. font created with this editor.
  249.  
  250.  
  251.      Finding a Character:
  252.  
  253.      Since most of the time, you will probably be creating your own text fonts 
  254. where  the special characters you enter are to replace existing alphanumerics,
  255. a  function was provided to help you "jump" to the location  corresponding  to
  256. a  specific alphanumeric.   This is particularly helpful when starting with  a
  257.  
  258.  
  259.                                 4                      Font Editor Version 1.2
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. completely  blank  table  and  you  are  only  interested  in  filling  a  few
  269. characters, thus reducing needless searching for the right location.
  270.      When  you strike the F8 key,  you are prompted to strike the key  of  the 
  271. character you wish the arrow pointer to jump to.   The ASCII value is computed 
  272. from the key you press, and the arrow pointer is relocated.
  273.  
  274.  
  275.      Quiting the Editor:
  276.  
  277.      The F10 key is used to exit the program gracefully.  If you have modified
  278. any of the characters since the last save command,  the editor will inform you 
  279. and give you an opportunity to save to file.
  280.  
  281.  
  282.      Editing a Character:
  283.  
  284.      The F5 key is used to edit a specific character:  where the arrow pointer 
  285. is located.   Once you have entered the edit mode,  you will be working in the 
  286. upper  half of the screen.   Notice that the function key commands change when 
  287. you  enter the edit mode,  and a large cursor is positioned within the 8  x  8 
  288. matrix  in  the upper middle portion of the screen.   This  matrix  represents 
  289. individual  "bits" or "pixels" (picture elements) by which the characters  are 
  290. made up.
  291.      The  arrow  keys are used to move the cursor about the  matrix,  and  the 
  292. space  bar is used to change a specific bit from "ON" to "OFF" or vice  versa.  
  293. The <Home>, <End>, <PgUp>, and <PgDn> keys are also supported: these cause the 
  294. cursor to move diagonally in the direction of the key.  As you change the bits 
  295. on  the matrix,  you will notice the character to the immediate right  of  the 
  296. matrix will also change.   This is what the character actually looks like, and 
  297. will help you decide on which bits should be "ON" and which should be "OFF".
  298.      Many  of  the function keys are self-explanatory and do not  need  to  be 
  299. expanded upon.  The F3, F4, F5, <ALT> F5, and F6 rotate the character as if it 
  300. were cylindrical (the right side attached to the left,  or the top attached to 
  301. the  bottom).   The inversion keys F7 and F8 present the "mirror image" of the 
  302. original  either  horizontally or vertically.   The F2 key switches  all  "ON" 
  303. pixels  to  "OFF" and vice versa,  thus making the new character the  negative 
  304. image of the original.
  305.      The F1 key performs the same task as the F7 key from the main  "Selector"
  306. mode  of  the editor.   You will be prompted to move the arrow pointer to  the 
  307. location to copy FROM and hit RETURN or to enter ESC to abort the copy action.
  308.      The F9 and F10 are the exit keys to return command back to the "Selector" 
  309. mode.   The only difference is that F9 saves the changes you have made to  the 
  310. character; F10 does not.
  311.  
  312.  
  313. A few points to remember:
  314.  
  315.      There  are  two  files  included  in  this  package  ("FONTED40.FNT"  and 
  316. "FONTED80.FNT")  which  are  fonts  designed to work  with  the  font  editors 
  317. themselves.   I suggest you do not tamper with these fonts.   However,  on the 
  318. chance  that  you do not like the "cursor" characters and "ON/OFF"  characters 
  319. the  Editor  mode of the editors use,  you can redefine them  by  loading  the 
  320. appropriate  font file and changes (0,0) through (0,3).   We recommend you  do 
  321. not, but ...
  322.  
  323.  
  324.  
  325.                                 5                      Font Editor Version 1.2
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.      Another  point to remember in using your own fonts is that it is possible 
  335. to display characters created from a variety of font files on the same screen!  
  336. Remember  that the characters are displayed in their bit format and not  their 
  337. ASCII value as in text mode.   Therefore, you can load one font file, write to 
  338. the screen, load another font file, and write to the screen, etc....  Once the 
  339. image is computed onto the screen,  no further accesses are made to update the 
  340. image.
  341.      When  you look at the Turbo Pascal source code that is included  in  this 
  342. package, you will notice that it was designed to allow you to load into RAM up 
  343. to  three different font sets and by simply calling a single  procedure,  jump 
  344. between the fonts as the active font.   Here is the catch: if you are familiar 
  345. with  the  ROM BIOS routines,  you know there is a way to read the  characters 
  346. displayed on the screen.   This routine works whether the system is in text or 
  347. graphics mode!   In text mode, reading the character at a specific location is 
  348. easy:  just  read the ASCII value at that memory location.   However,  in  the
  349. graphics  mode,  the BIOS actually goes out and reads in the bit map  at  that 
  350. location, and then goes to the bit mapping of the character font and looks for 
  351. a match!  This is very flexible, but you need to make sure that when, or if, a
  352. program tries to READ a character at a specific location in graphics mode, you 
  353. have the same font set active as the one used to create the character.
  354.  
  355.      The  data files stored to disk are the EXACT image the system expects  to 
  356. find  the  character fonts in when it access the area through  the  interrupt.  
  357. This  means  that there are no special translations from reading the  data  to 
  358. creating the font work area for DOS.  The result is that once you have created 
  359. a  font  set  to  your satisfaction,  you can access and  use  the  file  with 
  360. assembler,  Pascal,  C, BASIC, or any other language that allows you to do the 
  361. following actions:
  362.  
  363.      a)  load the ENTIRE contents of a font file into a specific  location  in 
  364. memory,
  365.      b)  and  access the DOS routine to change a specific  interrupt  vector's 
  366. location to point to the location the font file was loaded.
  367.  
  368.      The  Turbo  Pascal  routine  package  provided uses  DOS  to  change  the 
  369. interrupt  vector's address.   Although it is possible to directly change  the 
  370. address,  it is always good programming practice to let DOS do this,  to  keep 
  371. compatibility  with future DOS machines and to handle situations  when  inter-
  372. rupts occur WHILE the interrupt vector is being modified.
  373.  
  374.      That  is it!   I hope you enjoy this package and I hope it comes in handy
  375. in  developing your own fonts.   Strategically designed,  a program  can  look 
  376. quite nice while using this feature.  In fact, this editor can help you design 
  377. game  graphics  characters  that make manipulation of objects  on  the  screen 
  378. faster,  easier,  and  neater to code.   Remember,  if you like this  package, 
  379. please register with Synergy Software of Nebraska with a $10 donation.
  380.  
  381.      Thanks for using our products.
  382.  
  383.  
  384.  
  385. Synergy Software of Nebraska
  386. 904 Lariat Circle
  387. Papillion, NE  68046
  388.  
  389.  
  390.  
  391.                                 6                      Font Editor Version 1.2
  392.  
  393.  
  394.  
  395.  
  396.  
  397.